home *** CD-ROM | disk | FTP | other *** search
/ The Sunday Times: The Month 2003 December / The Sunday Times - The Month 2003-12.iso / mac / The Month DEC 03 / engine / modules / text_short.swf / scripts / frame_1 / DoAction.as
Text File  |  2003-05-30  |  1KB  |  42 lines

  1. function init()
  2. {
  3.    build();
  4.    _visible = true;
  5. }
  6. function build()
  7. {
  8.    var Colors = Tardis.Colors;
  9.    var strColor = Colors.getString(nodeData.attributes.color);
  10.    var strColor2 = Colors.getString(nodeData.attributes.color2);
  11.    var strColor3 = Colors.getString(nodeData.attributes.color3);
  12.    var strTitle = "<FONT COLOR=\"" + strColor + "\">" + nodeData.byName("title").getText() + " </FONT>";
  13.    strTitle += "<FONT COLOR=\"" + strColor2 + "\">" + nodeData.byName("title2").getText() + " </FONT>";
  14.    strTitle += "<FONT COLOR=\"" + strColor3 + "\">" + nodeData.byName("title3").getText() + " </FONT>";
  15.    txtTitle.htmlText = strTitle;
  16.    txtTitle.resize();
  17.    var ndBody = nodeData.byName("body");
  18.    txtBody.htmlText = ndBody.getText();
  19.    txtBody.positionUnder(txtTitle);
  20.    if(ndBody.attributes.scrollbar != null)
  21.    {
  22.       txtBody._width = WIDTH_WITH_SCROLLBAR;
  23.       txtBody._height = PANEL_BOTTOM - txtBody._y - 12;
  24.       cmpScroll.setSize(txtBody._height);
  25.       cmpScroll._visible = true;
  26.       cmpScroll.positionUnder(txtTitle,5);
  27.    }
  28.    else
  29.    {
  30.       cmpScroll._visible = false;
  31.       txtBody._width = WIDTH_NO_SCROLLBAR;
  32.       txtBody.resize();
  33.    }
  34. }
  35. _visible = false;
  36. stop();
  37. WIDTH_WITH_SCROLLBAR = 335;
  38. WIDTH_NO_SCROLLBAR = 350;
  39. HEIGHT_WITH_SCROLLBAR = 122;
  40. PANEL_BOTTOM = 187;
  41. onReady();
  42.